<!-- Delete Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Are you sure warnt delete?</h4>
      </div>
      <div class="modal-body">

        <form id="form-delete" action="" method="post">
        </form>

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
        <button type="button" id="submit-delete" class="btn btn-primary">Delete</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script type="text/javascript">

    /*Form delete*/
    $('.btn-delete').click(function()
    {
      var idDelete = $(this).closest('tr').prop('id');

      $('#submit-delete').click(function(event) 
      {
        $('#form-delete').attr('action', '<?php echo base_url(); ?>/index.php/category_controller/delete/' + idDelete);
        $('#form-delete').submit();
      });
    });

</script>